import os
import cv2
import utils
from tqdm import tqdm

path_jpg = r'/media/fang/Samsung USB/tsr/input_src/up'
path_output = r'/media/fang/3441-913C/up'

# NameNum = 0
for root, dirs, files in os.walk(path_jpg):
    for file in tqdm(files):
        # NameNum += 1
        img = cv2.imread(root + '/' + file)
        # utils.bgr2yuv420bin(path_output + '/%05d.yuv' % NameNum, img)
        utils.bgr2yuv420bin(path_output + '/' + file.replace('jpg', 'yuv'), img)
